package StructuralPattern.FacadePattern;

//外观类
public class HomeFacade {
    private Light light;
    private Stereo stereo;
    private AirConditioner airConditioner;

    public HomeFacade() {
        light = new Light();
        stereo = new Stereo();
        airConditioner = new AirConditioner();
    }

    public void enterHome() {
        System.out.println("到家了，智能家具自动打开");
        light.on();
        stereo.on();
        airConditioner.on();
    }

    public void leaveHome() {
        System.out.println("出门了，智能家具自动关闭");
        light.off();
        stereo.off();
        airConditioner.off();
    }
}